from . import flutter

TextStyle = flutter.TextStyle
Container = flutter.Container
Center = flutter.Center
Text = flutter.Text
Stack = flutter.Stack
Row = flutter.Row
Positioned = flutter.Positioned
Transform = flutter.Transform
LinearGradient = flutter.LinearGradient
Colors = flutter.Colors
TextAlign = flutter.TextAlign
EdgeInsets = flutter.EdgeInsets
FontWeight = flutter.FontWeight
FontStyle = flutter.FontStyle
BoxShadow = flutter.BoxShadow
BoxShape = flutter.BoxShape
RichText = flutter.RichText
TextSpan = flutter.TextSpan
TextOverflow = flutter.TextOverflow
BorderRadius = flutter.BorderRadius
Offset = flutter.Offset
Scaffold = flutter.Scaffold
AppBar = flutter.AppBar
IconButton = flutter.IconButton
Icon = flutter.Icon
Icons = flutter.Icons
MaterialBanner = flutter.MaterialBanner
# CircleAvatar = flutter.CircleAvatar
FlatButton = flutter.FlatButton
TextButton = flutter.TextButton
OutlinedButton = flutter.OutlinedButton
ContainedButton = flutter.ContainedButton
Column = flutter.Column
Card = flutter.Card
ListTile = flutter.ListTile
ListView = flutter.ListView
ButtonBar = flutter.ButtonBar
FlatButton = flutter.FlatButton
MainAxisAlignment = flutter.MainAxisAlignment
# ListView = flutter.ListView
PopupMenuButton = flutter.PopupMenuButton
# PopupMenuEntry = flutter.PopupMenuEntry
# BuildContext = flutter.BuildContext
PopupMenuItem = flutter.PopupMenuItem
PopupMenuDivider = flutter.PopupMenuDivider
PaginatedDataTable = flutter.PaginatedDataTable
CheckBox = flutter.CheckBox
DisabledCheckBox = flutter.DisabledCheckBox
ChoiceChip = flutter.ChoiceChip
RadioButton = flutter.RadioButton
Chip = flutter.Chip
TabButton = flutter.TabButton
TabBar = flutter.TabBar
DataTable = flutter.DataTable
AlertDialog = flutter.AlertDialog
Button = flutter.Button
Children = flutter.Children
TabButton = flutter.TabButton
Row = flutter.Row
TabBar = flutter.TabBar


def test():
    return Scaffold(
        appBar=AppBar(
            title=Text('Tabs'),
            leading=Icon(Icons.arrow_back, href="http://localhost:8000/web/_main_.html"),
            actions=[
                Icon(Icons.share),
                Container(
                    padding=EdgeInsets.symmetric(16),
                    child=Icon(Icons.search),
                ),
                Icon(Icons.more_vert),
            ],
        ),

        body=Container(
            TabBar(
                children=[
                    TabButton(
                        Icon(Icons.menu),
                        Text('Menus')
                    ),
                    TabButton(
                        Icon(Icons.search),
                        Text('SYSU')),
                    TabButton(
                        Icon(Icons.search),
                        Text('Tab3')),
                    TabButton(
                        Icon(Icons.search),
                        Text('Tab4')),
                    TabButton(
                        Icon(Icons.search),
                        Text('Tab5'))
                ],
                body=[
                    Positioned(
                        child=Children(
                            children=[
                                PopupMenuButton(
                                    # icon=Icon(Icons.more_vert),
                                    itemBuilder=[
                                        PopupMenuItem(
                                            child=ListTile(
                                                leading=Icon(Icons.preview),
                                                title=Text('Preview'),
                                            ),
                                        ),
                                        PopupMenuItem(
                                            child=ListTile(
                                                leading=Icon(Icons.share),
                                                title=Text('Share'),
                                            ),
                                        ),
                                        PopupMenuItem(
                                            child=ListTile(
                                                leading=Icon(Icons.delete),
                                                title=Text('Delete'),
                                            ),
                                        ),
                                        PopupMenuDivider(),
                                        PopupMenuItem(
                                            child=ListTile(
                                                leading=Icon(Icons.copy_all),
                                                title=Text('Copy'),
                                            ),
                                        ),
                                        PopupMenuItem(
                                            child=ListTile(
                                                leading=Icon(Icons.download),
                                                title=Text('Download'),
                                            ),
                                        ),
                                    ],
                                ),
                            ]
                        ),
                        left=130,
                        top=240
                    ),
                    Positioned(
                        child=Text('SYSU is the best university in the world!'),
                        left=20,
                        top=250,
                        color='red'
                    ),
                    Positioned(
                        child=Text('search3'),
                        left=130, top=240
                    ),
                    Positioned(
                        child=Text('search4'),
                        left=130,
                        top=240),
                    Positioned(
                        child=Text('search5'),
                        left=130,
                        top=240)
                ]
            ),

            width=320,
            height=424,
            color='#EFEFEF',
        ),
    )


def run_app():
    test_ = test()
    javascript.document.body.appendChild(test_.render())


run_app()
